﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataModel
{
    public interface IDataAccess
    {
        // pattern template
        IEnumerable<PatternTemplate> GetAllPatternTemplates();
        IEnumerable<PatternTemplate> GetAllPatternTemplates(string patternLibDirectoryPath);
        void AddPatternTemplate(PatternTemplate patternTemplate);
        void DeletePatternTemplate(PatternTemplate patternTemplate);
        void RemovePatternTemplate(int patternTemplateID);
        bool SavePatternTemplate(int ID, string name = null, string comments = null);
        void UpdateTemplateComment(int patternTemplateID, string templateCommments = null);

        // pattern instance
        IEnumerable<PatternInstance> GetAllPatternInstances();
        void AddPatternInstance(PatternInstance patternInstance);
        void DeletePatternInstance(PatternInstance patternModel);
        void RemovePatternInstance(int patternInstanceID);
        bool SavePatternInstance(int ID, string name = null, string comments = null);
        void UpdateInstanceComment(int patternInstanceID, string instanceComments = null);

        // pattern location
        IEnumerable<PatternLocation> GetAllPatternLocations();
        void AddPatternLocation(PatternLocation patternLocation);
        void AddPatternLocation(string locationName, string locationPath);
        IEnumerable<PatternLocation> GetAllPatternLocations(int patternInstanceID);

        // instance - location
        bool IsInstanceInLocation(int patternInstanceID, string locationPath);
        void AssignInstanceToLocation(int patternInstanceID, string patternLibDirectoryPath);
        void RemoveInstanceFromLocation(int patternInstanceID, string locationPath);
    }
}
